// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
// import 'babel-polyfill'
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import "babel-polyfill"
import 'muka-ui/lib/theme-default/index.scss'
import './css/iconfont.css'
import './less/index.less'

//工具函数常量
import Constants from './util/Constants.vue'
import Utils from './util/ToolsUtil.vue'
Vue.prototype.Constants = Constants
Vue.prototype.$util = Utils

//vux
import {
    ToastPlugin,
    LoadingPlugin,
    DatetimePlugin
} from 'vux'
Vue.use(ToastPlugin)
Vue.use(LoadingPlugin)
Vue.use(DatetimePlugin)

//缓存路由
import Navigation from 'vue-navigation'
Vue.use(Navigation, {router, store})

router.beforeEach(function (to, from, next) {
    Vue.$vux.loading.show()
    next()
})

router.afterEach(function (to) {
    Vue.$vux.loading.hide()
})

//ajax
import ajax from './components/ajax'
Vue.use(ajax)

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
    el: '#app',
    router,
    store,
    template: '<App/>',
    components: {
        App
    }
})
